import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/views/home-index'
import Resume from '@/views/home-resume'
import Morepage from '@/views/home-more/more-index'
import Character from '@/views/home-more/more-character/char-index'
import Tool from '@/util/Tool'

Vue.use(Router)

const router = new Router({
    routes: [
      {
        path: '/',
        name: 'Index',
        component: Index
      },
      {
         path: '/Resume',
         name: 'Resume',
         component: Resume
      },
      {
      	path: '/Morepage',
      	name: 'Morepage',
      	component: Morepage
      },
      {
        path: '/Character',
        name: 'Character',
        component: Character
      }
    ]
})
//权限认证
router.beforeEach((to, from, next) => {
    switch (to.name) {  //设置标题
        case 'Index': Tool.setTitle("首页"); break;
        case 'Resume': Tool.setTitle("个人简历"); break;
        case 'Morepage': Tool.setTitle('更多页面'); break;
        case 'Morepage': Tool.setTitle('标准普通话练习'); break;
    }
    next();
})
export default router;

